home *** CD-ROM | disk | FTP | other *** search
- /*
- File: EnvironmentTest.cp
-
- Contains: TEnvironment is a Gestalt wrapper class that finds out information about the environment.
- EnvironmentTest.h contains the test functions for the TEnvironment class.
-
- Written by: Kent Sandvik
-
- Copyright: Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
- 8/18/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
-
-
- */
- // INCLUDES
- #ifndef _ENVIRONMENT_
- #include "Environment.h"
- #endif
-
- // This test will check out the functions of the TEnvironment class. We assume that
- // we are running on a fairly typical System 7.0.1/7.1 system.
-
- void main(void)
-
- {
- cout << "Start of TEnvironment test…\n";
- TEnvironment myEnvironment;
-
- // 128k TEST
- if (myEnvironment.Check128k())
- cout << "We have a 128 or better system.\n";
- else
- cout << "We have an ancient Mac…\n";
-
- // APPLEEVENTS TEST
- if (myEnvironment.HasAppleEvents())
- cout << "We have Apple Events.\n";
- else
- cout << "We don't have Apple Events.\n";
-
-
- // COLOR QUICKDRAW TEST
- if (myEnvironment.HasColorQD())
- cout << "We have Color Quickdraw.\n";
- else
- cout << "We don't have Color Quickdraw.\n";
-
- // IS SYSTEM 7?
- if (myEnvironment.IsSystemSeven())
- cout << "We are running under System 7.\n";
- else
- cout << "We are NOT running under System 7.\n";
-
- // TEST GENERIC ATTRIBUTE
- if (myEnvironment.HasAttribute(gestaltFontMgrAttr, gestaltOutlineFonts))
- cout << "We have TrueType font support.\n";
- else
- cout << "We DON'T have TrueType font support.\n";
-
-
- // CHECK IF THE X TRAP IS AVAILABLE
- if (myEnvironment.TrapAvailable(OSTrap, 0xA82A))// Component Manager
- cout << "We have _ComponentDispatch.\n";
- else
- cout << "We don't have _ComponentDispatch.\n";
-
-
- cout << "End of TEnvironment test!\n";
- }
-
- // _________________________________________________________________________________________________________ //
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 11/9/92 New file
- */
-